package com.gupaowork.pattern.prototype;

import org.springframework.beans.BeanUtils;

/**
 * @Author heweicheng
 */
public class UserService {
    public UserOnline getUsesOnline(UserVo vo) {

        UserOnline userOnline = new UserOnline();
//        usesOnline.setBrowser(vo.getBrowser());
//        usesOnline.setDeptName(vo.getDeptName());
//        usesOnline.setIpaddr(vo.getIpaddr());
//        usesOnline.setLoginLocation(vo.getLoginLocation());
//        usesOnline.setOs(vo.getOs());
//        usesOnline.setSessionId(vo.getSessionId());
//        usesOnline.setLoginName(vo.getLoginName());
//        usesOnline.setExpireTime(1L);

        //原型模式复制对象属性
        BeanUtils.copyProperties(vo, userOnline);
        return userOnline;
    }
}
